package com.kawa.controller;

import com.kawa.model.R;
import com.kawa.service.UsersService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: KAIyo
 * @Date: 2025/7/24 10:27
 * @Version: v1.0.0
 * @Description: TODO
 **/
@RestController
public class UsersController {

    @Autowired
    private UsersService usersService;

    /**
     * 检查手机号是否注册
     *
     * @param mobile 手机号
     * @param countryCode 国家代码
     * @return
     */
    @GetMapping("/users/checkTel")
    public R checkPhone(@Param("mobile") String mobile, @Param("countryCode")String countryCode){



        return usersService.checkPhone(mobile,countryCode)?R.ok():R.fail("手机号已被注册");

    }



}
